const initState = {
    token: '',
    isLogin: localStorage.getItem('isLogin') || false
}

export function addToken(state = initState, action) {
    switch (action.type) {
        case 'ADD_TOKEN':
            return { ...initState, token: action.token };
        case 'ADD_LOGIN':
            return { ...initState, isLogin: action.isLogin }
        default:
            return { ...initState };
    }
}
